<extend name="Public/base" />

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>恒指合约列表</h2>
	</div>
	<form method = "post" action = "{:U('FuturesOption/del')}">
	<div class="cf">
		<div class="fl">
            <a class="btn" href="{:U('futuresOption/add')}">新 增</a>
<!--            <button class="btn ajax-post" url="{:U('FuturesType/changeStatus',array('method'=>'resumeUser'))}" target-form="ids">启 用</button>
            <button class="btn ajax-post" url="{:U('FuturesType/changeStatus',array('method'=>'forbidUser'))}" target-form="ids">禁 用</button>-->
            <button class="btn confirm" url="{:U('FuturesOption/del',array('method'=>'deleteUser'))}" target-form="ids">删 除</button>
        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <select name="status" id="status">
                    <option value="-1" <if condition="$status eq -1">selected</if>  style="width:200px">状态选择</option>
                    <option value="1" <if condition="$status eq 1">selected</if>  style="width:200px">开启</option>
                    <option value="2" <if condition="$status eq 2">selected</if>  style="width:200px">禁止</option>
                </select>
            </div>
            <div class="sleft">
                <input type="text" name="name" class="search-input" value="{:I('name')}" placeholder="名称">
            </div>
            <div class="sleft">
                <input type="text" name="code" class="search-input" value="{:I('code')}" placeholder="代码">
            </div>
            
            <div class="sleft">
                <input type="text" id="create_time" name="create_time"  class="search-input" value="{:I('create_time')}" placeholder="创建时间">
            </div>
            <div class="sleft">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('index')}"><i class="btn-search"></i></a>
            </div>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
	<table class="">
    <thead>
        <tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="">ID</th>
		<th class="">名称</th>
        <th class="">代码</th>
		<th class="">状态</th>
		<th class="">创建时间</th>
        <th class="">操作</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="list">
		<volist name="list" id="vo">
		<tr>
            <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
			<td>{$vo.id} </td>
			<td>{$vo.name}</td>
            <td>{$vo.code}</td>
            <td><if condition="$vo['status'] eq 1">启动中<else />禁止中</if></td>
			<td><span>{$vo.create_time|time_format}</span></td>
			<td>
			 	<a href="{:U('FuturesOption/edit?id='.$vo['id'])}">编辑</a>
				<a href="{:U('FuturesOption/del?ids='.$vo[id])}" class="confirm">删除</a>
            </td>
		</tr>
		</volist>
		<else/>
		<td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table> 
	</div>
	</form>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js?v={:SITE_VERSION}" charset="UTF-8"></script>
	<script src="__STATIC__/thinkbox/jquery.thinkbox.js?v={:SITE_VERSION}"></script>
	<script type="text/javascript">
	 $('#begin_time,#end_time,#create_time').datetimepicker({
            format: 'yyyy-mm-dd',
            language:"zh-CN",
            minView:2,
            autoclose:true,
        });
	 //搜索功能
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            var status=$('#status').val();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            query+="&status="+status;
			
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            //alert(url);
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
    //导航高亮
    $('.side-sub-menu').find('a[href="{:U('FuturesOption/index')}"]').closest('li').addClass('current');
	</script>
</block>
